Fix incorrect timing parameter passed to run_scanners#4783
Fix incorrect timing parameter passed to run_scanners#4783codewithfourtix wants to merge 3 commits intoaboutcode-org:developfrom
Conversation
The run_scanners call was passing 'timeout' (a float, default 120.0) as the 'timing' argument instead of the 'timing' boolean flag. This caused per-file scan timings to always be collected regardless of the --timing CLI option. Signed-off-by: codewithfourtix <codewithfourtix@gmail.com>
There was a problem hiding this comment.
Pull request overview
Fixes an incorrect argument being passed to run_scanners() from the main scan orchestration path (run_scan()), so that per-file scan timing collection correctly follows the --timing CLI flag rather than being implicitly enabled by the (truthy) timeout value.
Changes:
- Correct
run_scanners(..., timing=...)to use thetimingboolean instead oftimeout. - Restores expected CLI behavior where per-file scan timings are only collected when
--timingis enabled.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: codewithfourtix <codewithfourtix@gmail.com>
Remove incorrect @pytest.mark.scanslow and @pytest.mark.skipif decorators that were accidentally copied from the test above. This test should run on all platforms including Windows. Signed-off-by: codewithfourtix <codewithfourtix@gmail.com>
|
Added regression test test_scan_without_timing_flag_does_not_collect_scan_timings in the latest commit. The test verifies that scan_timings is empty for all files when --timing is not passed, and passes locally on Windows. |
|
I notice the CI failure is on test_scan_with_timing_jsonpp_return_timings_for_each_scanner, not my new test. Could you confirm whether this failure is related to my change or a pre-existing issue? Happy to investigate and fix if needed |
Fix
timing=timeouttypo inrun_scannerscall inrun_scanThe
run_scannerscall was passingtimeout(a float, default 120.0) as thetimingargument instead of thetimingboolean flag. This caused per-file scan timings to always be collected regardless of the--timingCLI option.Tasks
Run [tests](https://scancode-toolkit.readthedocs.io/en/latest/contribute/contrib_dev.html#running-tests) locally to check for errors.